import styles from './VideoIcon.less';

import IconVideo from '../../assets/icon/icon-video@2x.png';

const VideoIcon = ({ meeting, style, showLabel }) => {
  const onOpenVideo = (e) => {
    e.stopPropagation();
    window.open(meeting.videoUrl);
  };

  console.log(meeting.videoType && meeting.videoUrl);

  return (
    <>
      {meeting.videoType && meeting.videoUrl ? (
        <div className={styles.videoBox} style={{ ...style }} onClick={onOpenVideo}>
          <img
            src={IconVideo}
            style={{
              width: 24,
              height: 24,
            }}
          />
          {showLabel && <span className={styles.videoLabel}>进入视频</span>}
        </div>
      ) : (
        ''
      )}
    </>
  );
};

export default VideoIcon;
